<?php $all_session = $this->session->all_userdata(); ?>
<!DOCTYPE html>
<!-- saved from url=(0056)http://startbootstrap.com/templates/simple-sidebar.html# -->
<html lang="en">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<meta charset="utf-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<meta name="description" content="">
<meta name="author" content="">
<title>Panel</title>
<script src="<?php echo base_url();?>js/chart.js"></script>
<?php $this->load->view('panel_head');?>
</head>

<body onload="startTime()">
<?php $this->load->view('panel_header');?>
<div style="height:46px;"></div>
<div id="wrapper"> 
  
  <!-- Sidebar -->
  <div id="sidebar-wrapper">
    <?php $this->load->view('panel_sidebar');?>
  </div>
  
  <!-- Page content -->
  <div id="page-content-wrapper">
    <div class="content-header">
      <h1><span class="glyphicon glyphicon-film"></span>&nbsp;New Videos</h1>
    </div>
    <!-- Keep all page content within the page-content inset div! -->
    
    <div class="page-content inset">
      <div class="row" style="margin-bottom:1em;">
        <div class="col-md-12" >
          <div style="float:left"> <a href="<?php echo base_url();?>index.php/pvdo/upload">
            <button type="button" class="btn btn-success"><span class="glyphicon glyphicon-plus-sign"></span>&nbsp;Upload New Video</button>
            </a> </div>
          <span style="float:right">
          <?php echo form_open('pvdo/search_approve');?>
          		<input type="text" class="form-control" placeholder="  Search videos..." name="search">
          <?php echo form_close();?>
          </span>
          <div style="float:right"></div>
        </div>
        <!-- <div class="col-md-12"> --> 
        
      </div>
      <!-- <div class="row"> -->
      
      <div class="row" style="margin-bottom:1em;" >
        <div class="col-md-12">
          <div style="float:left">
            Pending (<?php echo $sum_ban; ?>) </div>
          <div style="float:right"> <?php if($all_session['login'][0]['mem_type'] == 2) { echo @$total_rows; } else { echo $all; }?> items </div>
        </div>
        <!-- <div class="col-md-12"> --> 
      </div>
      <!-- <div class"row"> -->
      

      
     

 <div>
    
      <div class="pagination" style="float:left; margin:0; padding:0;">
        <?php 	echo $this->pagination->create_links(); ?>
        

        </div><!-- pagination -->
   
   			
            
        
    <?php if($this->uri->segment(2) == 'search_approve') { ?> 
         	<?php echo form_open('pvdo/search_approve');?>
    <?php } else { ?>
   			<?php echo form_open('pvdo/approve');?>
    <?php } ?>
    
    
     <div style="float:right; margin-left:1em; margin-bottom:1em;"> 
    <select class="form-control" style="width:16em;" name="result_by" id="result_by" onChange="this.form.submit()" >
      <?php if(@$all_session['result_by'] == 'vdo_id') { ?>
      <option value="vdo.vdo_id">-- result by No. --</option>
      <?php } ?>
      <?php if(@$all_session['result_by'] == 'vdo_name') { ?>
      <option value="vdo_name">-- result by name --</option>
      <?php } ?>
      <?php if(@$all_session['result_by'] == 'vdo_uploadtime') { ?>
      <option value="vdo_uploadtime">-- result by uploaded time --</option>
      <?php } ?>      
      <?php if(@$all_session['result_by'] == 'vdo_dislike') { ?>
      <option value="vdo_dislike">-- result by dislike --</option>
      <?php } ?>
      <?php if(@$all_session['result_by'] == 'vdo_like') { ?>
      <option value="vdo_like">-- result by like --</option>
      <?php } ?>
      <?php if(@$all_session['result_by'] == 'vdo_view') { ?>
      <option value="vdo_view">-- result by view --</option>
      <?php } ?>
      <option value="vdo.vdo_id">result by No.</option>
      <option value="vdo_name">result by name</option>
      <option value="vdo_uploadtime">result by last upload</option>      
      <option value="vdo_dislike">result by dislike</option>
      <option value="vdo_like">result by like</option>
      <option value="vdo_view">result by view</option>
    </select>

      		</div>
    
     <div style="float:right;"> 
    <select class="form-control" name="category_by" onChange="this.form.submit()">
    
    	<?php foreach($category as $by_name) { ?>
            <?php if(@$by_name['category_id'] == @$all_session['category_by'] ) { ?>
             <option value="<?php echo @$all_session['category_by'];?>">-- <?php echo @$by_name['category_name']; ?>--</option>
             <?php } ?>
        <?php } ?>
            
            
           <option value="all">All category</option>
              <?php foreach ($category as $category)
				  	echo '<option value="'.$category['category_id'].'">'.$category['category_name'].'</option>';
			  ?>
    </select>
   </div>
             
         <?php echo form_close();?>

           
          <?php echo form_open('pvdo/update_status');?>
        <table class="table table-bordered"> 
          <tr class="bg-primary">
            <td colspan="6"><div style="float:left; margin:0 1em 0 0;">
                <input type="checkbox" name="select_all" id="select_all" style="width:1.7em; height:1.7em;" value="Y">
              </div>
              <span style="text-align:center">
              <select class="form-control" style="width:8em;" name="status">
                <option>Bulk Action</option>
                <option>-----------</option>
                <option value="0">Public</option>
                <option value="1">Private</option>
                <!--
                <option value="2">Ban</option>
                -->
              </select>
              <button type="submit" class="btn btn-default" data-dismiss="modal">Apply</button>
              </span>
              <div style="float:right;">
              
             
                
             
                
              
              </div></td>
          </tr>
        </table>
    
      <!-- <div class="table-responsive"> -->
      
      <div style="margin-left:0.7em; ">
      
      
      <?php $i=1; ?>
        <?php foreach($vdo as $feed) { ?>  
        
     
      
        <!-- <div class"row"> -->        
        <div class="row" style="margin-bottom:1.5em;">
          <div class="col-md-2">
            <div style="float:left;">
            	
              <input type="checkbox" name="select_all[]"style="width:1.7em; height:1.7em;" value="<?php echo $feed['vdo_id'];?>">
            </div>
            <div align="center"> <a href="<?php echo base_url();?>index.php/pvdo/profile/<?php echo $feed['vdo_id']; ?>"><img src="<?php echo base_url();?>vod_thumb/<?php echo $feed['vdo_rawfile'];?>/<?php echo $feed['thumb_name'];?>"/ width="80%"></a> </div>
          </div>
          <!-- <div class="col-md-2"> -->
          <div class="col-md-6" >
            <div><a href="<?php echo base_url();?>index.php/pvdo/profile/<?php echo $feed['vdo_id']; ?>"><?php echo $feed['vdo_name']; ?></a></br>
              <font size="-2"><?php echo $feed['vdo_uploadtime'];?></font></br>
              <!--
              <ul class="nav nav-pills" >
                <li> <a data-toggle="dropdown" href="#" style="padding:0.05em 0.5em;"><font size="2"><strong>edit</strong> <b class="caret"></b></font></a>
                  <ul class="dropdown-menu" >
                    <li ><a href="<?php echo base_url();?>index.php/pvdo/profile/<?php echo $feed['vdo_id']; ?>">Information and Setting</a></li>
                    <li class="divider"></li>
                    <li ><a href="#">Delete</a></li>
                  </ul>
                </li>
              </ul>
              <!-- /pills --> 
              
            </div>
            <?php echo form_close();?>
          </div>
          <!-- <div class="col-md-8"> -->
          
          <div class="col-md-2" style="margin-top:1em;">
          
          <?php if($feed['vdo_status'] == '') { ?>
<button type="button" class="btn btn-default" data-dismiss="modal" style="margin-right:1em"><font color="d9534f"><span class="
glyphicon glyphicon-time"></span></font></button>
            <?php } ?>
          <?php if($feed['vdo_status'] == '0') { ?>
<button type="button" class="btn btn-default" data-dismiss="modal" style="margin-right:1em"><font color="#5cb85c"><span class="glyphicon glyphicon-globe"></span></font></button>
		<?php } ?>
        	<?php if($feed['vdo_status'] == 1) { ?>
<button type="button" class="btn btn-default" data-dismiss="modal" style="margin-right:1em"><font color="f0ad4e"><span class="
glyphicon glyphicon-remove-sign"></span></font></button>
            <?php } ?>
            
           
          </div>
          <!-- <div class="col-md-3"> -->
          <div class="col-md-2">
            <table>
              <tr>
                <td>
                <span class="glyphicon glyphicon-stats"></span> <?php echo $feed['vdo_view'];?>
				</td>
              </tr>
              <tr>
                <td><span class="glyphicon glyphicon-thumbs-up"></span> <?php echo $this->player_model->like($feed['vdo_id']); ?></td>
                <td><span class="glyphicon glyphicon-thumbs-down"></span> <?php echo $this->player_model->dislike($feed['vdo_id']); ?></td>
              </tr>
              <tr>
                <td><span class="glyphicon glyphicon-exclamation-sign"></span> <?php echo count($this->pvdo_model->report($feed['vdo_id']));?></td>
              </tr>
            </table>
          </div>
          <!-- <div class="col-md-3"> --> 
        </div>
        <!-- <div class"row"> -->
        
        
          
       
     	<?php $i++; } ?>  
        
        
        	
      
        <hr>
      
      
      
        
       
        
         
        
     
        
      </div>
      <!-- <div margin> --> 
      
      <div class="pagination">
        <?php 	//echo $this->pagination->create_links(); ?>
        </div><!-- pagination -->
      
      
      
      
      
      
      
      
    </div>
    <!-- <div class="page-content inset"> --> 
    
  </div>
  <!--  <div id="page-content-wrapper"> --> 
  </div>
</div>
<!-- <div id="wrapper"> --> 


<!-- Custom JavaScript for the Menu Toggle --> 
<script>
    $("#menu-toggle").click(function(e) {
        e.preventDefault();
        $("#wrapper").toggleClass("active");
    });
</script> 

<!-- checkbox --> 
<script>
$('#select_all').click(function(event) {   
    if(this.checked) {
        // Iterate each checkbox
        $(':checkbox').each(function() {
            this.checked = true;                        
        });
    }else{
		$(':checkbox').each(function() {
			this.checked = false;
		});
	}
});
</script>
</body>
</html>